<template>
  <div class="section">
    <son :articles="articleList" @onEmitIndex="onEmitIndex"></son>
    <p>{{ currentIndex }}</p>
  </div>
</template>

<script>
import son from "./son.vue";
export default {
  name: "comArticle",
  components: { son },
  data() {
    return {
      currentIndex: -1,
      articleList: ["红楼梦", "西游记", "三国演义"],
    };
  },
  methods: {
    onEmitIndex(idx) {
      this.currentIndex = idx;
    },
  },
};
</script>
